package com.psy.counseling.controller;


import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.psy.counseling.entity.FirstVisit;
import com.psy.counseling.service.impl.FirstVisitServiceImpl;
import com.psy.counseling.vo.DeleteVO;
import com.psy.counseling.vo.FirstVisitVo;
import com.psy.counseling.vo.PageVO;
import com.psy.counseling.vo.ResultVo;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author 梁学儒
 * @since 2022-05-31
 */
@RestController
@RequestMapping("/api/first-visit")
public class FirstVisitController {
    @Resource
    private FirstVisitServiceImpl firstVisitService;

    @PostMapping("/addFirstVisit")
    public ResultVo addFirstVisit(@RequestBody FirstVisit firstVisit) {
        return firstVisitService.addFirstVisit(firstVisit);
    }

    @DeleteMapping("/deleteFirstVisit")
    public ResultVo addFirstVisit(@RequestBody DeleteVO deleteVO) {
        return firstVisitService.deleteFirstVisit(deleteVO);
    }

    @GetMapping("/getFirstVisit")
    public ResultVo getFirstVisit(FirstVisit firstVisit, PageVO page) {
        return firstVisitService.listFirstVisits(firstVisit,page);
    }

    @PostMapping("/updateFirstVisit")
    public ResultVo updateFirstVisit(@RequestBody FirstVisit firstVisit) {
        return firstVisitService.updateFirstVisit(firstVisit);
    }

    @PutMapping("/agreeFirstVisit")
    public ResultVo agreeFirstVisit(@RequestBody FirstVisit firstVisit) {
        return firstVisitService.agreeFirstVisit(firstVisit);
    }

    @PutMapping("/opposeFirstVisit/{id}")
    public ResultVo opposeFirstVisit(@PathVariable("id") Long id) {
        return firstVisitService.opposeFirstVisit(id);
    }

    @PutMapping("/cancelFirstVisit/{id}")
    public ResultVo cancelFirstVisit(@PathVariable("id") Long id) {
        return firstVisitService.cancelFirstVisit(id);
    }

    @GetMapping("/status/{id}")
    public ResultVo getStatus(@PathVariable("id") Long id) {
        return firstVisitService.getStatus(id);
    }

    @GetMapping("/getConclusion")
    public ResultVo getConclusion() {
        return firstVisitService.getConclusion();
    }

    @GetMapping("/getVisitType")
    public ResultVo getVisitType() {
        return firstVisitService.getVisitType();
    }

}

